package com.ht.service.impl;



import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ht.dto.Drug;
import com.ht.mapper.DrugMapper;
import com.ht.service.IDrugService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 代齐园
 * @since 2022-05-28
 */
@Service
public class DrugServiceImpl extends ServiceImpl<DrugMapper, Drug> implements IDrugService {

    @Resource
    private DrugMapper drugMapper;

    @Override
    public List<Drug> getDrug(Long id) {
        QueryWrapper<Drug> queryWrapper = new QueryWrapper();
        queryWrapper.eq("user_id",id).eq("status",0);
        List<Drug> drugs = drugMapper.selectList(queryWrapper);
        return drugs;
    }
}
